package com.YHVision.qiuzhike.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.YHVision.qiuzhike.model.dto.chart.ChartQueryRequest;
import com.YHVision.qiuzhike.model.entity.Chart;
import com.YHVision.qiuzhike.model.vo.ChartVO;

import javax.servlet.http.HttpServletRequest;

/**
 * AI助手服务
 *
 * @author <a href="">YHVision-小y</a>
 * @from <a href="todo">爱编程学习圈</a>
 */
public interface ChartService extends IService<Chart> {

    /**
     * 校验数据
     *
     * @param chart
     * @param add 对创建的数据进行校验
     */
    void validChart(Chart chart, boolean add);

    /**
     * 获取查询条件
     *
     * @param chartQueryRequest
     * @return
     */
    QueryWrapper<Chart> getQueryWrapper(ChartQueryRequest chartQueryRequest);
    
    /**
     * 获取AI助手封装
     *
     * @param chart
     * @param request
     * @return
     */
    ChartVO getChartVO(Chart chart, HttpServletRequest request);

    /**
     * 分页获取AI助手封装
     *
     * @param chartPage
     * @param request
     * @return
     */
    Page<ChartVO> getChartVOPage(Page<Chart> chartPage, HttpServletRequest request);
}
